﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text; 
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Project_Origin
{
    public partial class PO_Select_Difficult : Form
    {
        public PO_Select_Difficult()
        {
            InitializeComponent();
        }
        //定义鼠标点位
        private Point mousePoint = new Point();

        //计时器，实现慢关

        private void PO_Timer1_Tick(object sender, EventArgs e)
        {
            if (this.Opacity >= 0.3)
                this.Opacity -= 0.3;
            else
            {
                PO_Timer1.Stop();
                this.Close();
                Environment.Exit(Environment.ExitCode);
            }
        }
        //窗口移动组件
        private void PO_Select_Difficult_MouseDown(object sender, MouseEventArgs e)
        {
            this.mousePoint.X = e.X;
            this.mousePoint.Y = e.Y;
        }

        private void PO_Select_Difficult_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Top = Control.MousePosition.Y - mousePoint.Y + 13;
                this.Left = Control.MousePosition.X - mousePoint.X + 13;
            }
        }
        //退出按键
        private void PO_Button_Exit_Click(object sender, EventArgs e)
        {
            PO_Timer1.Start();
        }
        //最小化按键
        private void PO_MixNum_Button_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }

        //模式选择：简单、普通、困难
        PO_Classical_Mode_UI pO_Classical_Mode_UI = new PO_Classical_Mode_UI();
        private void PO_Button_Easy_Click(object sender, EventArgs e)
        {
            this.Dispose();
            this.Close();
            PO_Classical_Mode_UI pcmu = new PO_Classical_Mode_UI(1);
            pcmu.Show();
            
        }

        private void PO_Button_Normal_Click(object sender, EventArgs e)
        {
            this.Dispose();
            this.Close();
            PO_Classical_Mode_UI pcmu = new PO_Classical_Mode_UI(2);
            pcmu.Show();
        }

        private void PO_Button_Hard_Click(object sender, EventArgs e)
        {
            this.Dispose();
            this.Close();
            PO_Classical_Mode_UI pcmu = new PO_Classical_Mode_UI(3);
            pcmu.Show();
        }

        //返回
        private void PO_Button_Back_Click(object sender, EventArgs e)
        {
            this.Dispose();
            this.Close();
            PO_ModeSelect_Menu pO_ModeSelect_Menu = new PO_ModeSelect_Menu();
            pO_ModeSelect_Menu.Show();
        }


    }
}
